#pragma once
#include <Scene.hpp>
#include <EntityManagement.h>
#include <so_math.h>
#include <Static.hpp>
#include <Component.hpp>
#include <Button.hpp>
#include <list>
#include <GameMessage.h>
#include <Navmesh.h>
class SpaceScene : public Scene
{
private:
    EntityManagement *entityManagement;
    // std::vector<Entity*> selected_list;
    int drag_x;
    int drag_y;
    int cursor_x;
    int cursor_y;
    bool press_left = false;
    Timer game_timer;
    std::list<Component *> components_list;
    GameMessage msg;

    Button *btn_move;
    Button *btn_stop;
    Button *btn_hold;
    Button *btn_attack;
    Button *btn_patrol;

    int ui_bottom_x;
    int ui_bottom_y;
    int ui_bottom_width;
    int ui_bottom_height;
    int ui_group_x;
    int ui_group_y;
    int ui_group_width;
    int ui_group_height;
    int ui_order_x;
    int ui_order_y;
    int ui_order_width;
    int ui_order_height;
    int ui_group_icon_x;
    int ui_group_icon_y;
    int ui_group_icon_width;
    int ui_group_icon_height;
    int ui_gold_icon_width;
    int ui_gold_icon_height;
    int ui_gold_icon_x;
    int ui_gold_icon_y;

    int ui_map_x;
    int ui_map_y;
    int ui_map_width;
    int ui_map_height;

    int map_width;
    int map_height;

public:
    SpaceScene() = default;
    ~SpaceScene();
    virtual void init() override;
    virtual void renderUI(SDL_Renderer *renderer);
    void render(SDL_Renderer *renderer) override;
    void renderEntities(SDL_Renderer *renderer);
    void renderEffects(SDL_Renderer *renderer);
    void renderBullets(SDL_Renderer *renderer);
    void updateSize();
    virtual int update(real delta) override;
    virtual int handleEvent(SDL_Event &evt) override;
};